package com.fly.push.service;

import java.util.List;

import org.apache.commons.lang3.RandomUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.stereotype.Service;

import com.google.common.collect.Lists;

@Service
public class DataService
{
    /**
     * 此推送数据vue3展示页面user.html
     * 
     * @return
     * @see [类、类#方法、类#成员]
     */
    public List<User> getUsers()
    {
        String now = DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss");
        Long sequence = 1L;
        return Lists.newArrayList(new User().setUserId(sequence).setUserName("user_" + sequence).setAge(RandomUtils.nextInt(10, 40)).setDesc("This is a user " + sequence++).setCreateTime(now),
            new User().setUserId(sequence).setUserName("user_" + sequence).setAge(RandomUtils.nextInt(10, 40)).setDesc("This is a user " + sequence++).setCreateTime(now),
            new User().setUserId(sequence).setUserName("user_" + sequence).setAge(RandomUtils.nextInt(10, 40)).setDesc("This is a user " + sequence++).setCreateTime(now),
            new User().setUserId(sequence).setUserName("user_" + sequence).setAge(RandomUtils.nextInt(10, 40)).setDesc("This is a user " + sequence++).setCreateTime(now),
            new User().setUserId(sequence).setUserName("user_" + sequence).setAge(RandomUtils.nextInt(10, 40)).setDesc("This is a user " + sequence++).setCreateTime(now));
    } 
}
